load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@kubevirt//tools/ginkgo:ginkgo.bzl", "ginkgo_test")

go_library(
    name = "go_default_library",
    srcs = [
        "application.go",
        "kubevirt.go",
        "strategy.go",
        "strategy_job.go",
    ],
    importpath = "kubevirt.io/kubevirt/pkg/virt-operator",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/certificates/bootstrap:go_default_library",
        "//pkg/controller:go_default_library",
        "//pkg/monitoring/metrics/common/client:go_default_library",
        "//pkg/monitoring/metrics/virt-operator:go_default_library",
        "//pkg/monitoring/profiler:go_default_library",
        "//pkg/pointer:go_default_library",
        "//pkg/service:go_default_library",
        "//pkg/util/cluster:go_default_library",
        "//pkg/util/tls:go_default_library",
        "//pkg/util/webhooks/validating-webhooks:go_default_library",
        "//pkg/virt-config:go_default_library",
        "//pkg/virt-controller/leaderelectionconfig:go_default_library",
        "//pkg/virt-operator/resource/apply:go_default_library",
        "//pkg/virt-operator/resource/generate/components:go_default_library",
        "//pkg/virt-operator/resource/generate/install:go_default_library",
        "//pkg/virt-operator/resource/placement:go_default_library",
        "//pkg/virt-operator/util:go_default_library",
        "//pkg/virt-operator/webhooks:go_default_library",
        "//staging/src/kubevirt.io/api/core/v1:go_default_library",
        "//staging/src/kubevirt.io/client-go/kubecli:go_default_library",
        "//staging/src/kubevirt.io/client-go/log:go_default_library",
        "//staging/src/kubevirt.io/client-go/util:go_default_library",
        "//vendor/github.com/emicklei/go-restful/v3:go_default_library",
        "//vendor/github.com/prometheus/client_golang/prometheus/promhttp:go_default_library",
        "//vendor/github.com/spf13/pflag:go_default_library",
        "//vendor/golang.org/x/time/rate:go_default_library",
        "//vendor/k8s.io/api/apps/v1:go_default_library",
        "//vendor/k8s.io/api/batch/v1:go_default_library",
        "//vendor/k8s.io/api/core/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library",
        "//vendor/k8s.io/client-go/kubernetes/scheme:go_default_library",
        "//vendor/k8s.io/client-go/kubernetes/typed/core/v1:go_default_library",
        "//vendor/k8s.io/client-go/rest:go_default_library",
        "//vendor/k8s.io/client-go/tools/cache:go_default_library",
        "//vendor/k8s.io/client-go/tools/leaderelection:go_default_library",
        "//vendor/k8s.io/client-go/tools/leaderelection/resourcelock:go_default_library",
        "//vendor/k8s.io/client-go/tools/record:go_default_library",
        "//vendor/k8s.io/client-go/util/certificate:go_default_library",
        "//vendor/k8s.io/client-go/util/workqueue:go_default_library",
        "//vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset:go_default_library",
    ],
)

go_test(
    name = "go_default_test",
    timeout = "long",
    srcs = [
        "application_test.go",
        "kubevirt_test.go",
        "virt_operator_suite_test.go",
    ],
    embed = [":go_default_library"],
    race = "on",
    tags = ["cov"],
    deps = [
        "//pkg/apimachinery/patch:go_default_library",
        "//pkg/certificates/triple/cert:go_default_library",
        "//pkg/controller:go_default_library",
        "//pkg/monitoring/rules:go_default_library",
        "//pkg/pointer:go_default_library",
        "//pkg/testutils:go_default_library",
        "//pkg/virt-operator/resource/apply:go_default_library",
        "//pkg/virt-operator/resource/generate/components:go_default_library",
        "//pkg/virt-operator/resource/generate/install:go_default_library",
        "//pkg/virt-operator/resource/generate/rbac:go_default_library",
        "//pkg/virt-operator/util:go_default_library",
        "//staging/src/kubevirt.io/api/core/v1:go_default_library",
        "//staging/src/kubevirt.io/api/instancetype/v1beta1:go_default_library",
        "//staging/src/kubevirt.io/client-go/kubecli:go_default_library",
        "//staging/src/kubevirt.io/client-go/kubevirt/fake:go_default_library",
        "//staging/src/kubevirt.io/client-go/prometheusoperator/fake:go_default_library",
        "//staging/src/kubevirt.io/client-go/testing:go_default_library",
        "//staging/src/kubevirt.io/client-go/testutils:go_default_library",
        "//staging/src/kubevirt.io/client-go/version:go_default_library",
        "//vendor/github.com/evanphx/json-patch:go_default_library",
        "//vendor/github.com/onsi/ginkgo/v2:go_default_library",
        "//vendor/github.com/onsi/gomega:go_default_library",
        "//vendor/github.com/openshift/api/route/v1:go_default_library",
        "//vendor/github.com/openshift/api/security/v1:go_default_library",
        "//vendor/github.com/openshift/client-go/route/clientset/versioned/typed/route/v1/fake:go_default_library",
        "//vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1/fake:go_default_library",
        "//vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1:go_default_library",
        "//vendor/go.uber.org/mock/gomock:go_default_library",
        "//vendor/k8s.io/api/admissionregistration/v1:go_default_library",
        "//vendor/k8s.io/api/apps/v1:go_default_library",
        "//vendor/k8s.io/api/batch/v1:go_default_library",
        "//vendor/k8s.io/api/coordination/v1:go_default_library",
        "//vendor/k8s.io/api/core/v1:go_default_library",
        "//vendor/k8s.io/api/policy/v1:go_default_library",
        "//vendor/k8s.io/api/rbac/v1:go_default_library",
        "//vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1:go_default_library",
        "//vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/fake:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/util/intstr:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/util/rand:go_default_library",
        "//vendor/k8s.io/client-go/kubernetes/fake:go_default_library",
        "//vendor/k8s.io/client-go/testing:go_default_library",
        "//vendor/k8s.io/client-go/tools/cache:go_default_library",
        "//vendor/k8s.io/client-go/tools/record:go_default_library",
        "//vendor/k8s.io/client-go/util/workqueue:go_default_library",
        "//vendor/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1:go_default_library",
    ],
)

ginkgo_test(
    name = "go_parallel_test",
    timeout = "long",
    ginkgo_args = ["-p"],
    go_test = ":go_default_test",
    tags = ["nocov"],
)
